package com.tianming.vrd.controller;

import com.tianming.vrd.entity.Category;
import com.tianming.vrd.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CategoryController {
    @Autowired(required = false)
    CategoryMapper categoryMapper;

    @RequestMapping("/category/select")
    public List<Category> select(){
        return categoryMapper.select();
    }

    @RequestMapping("/category/insert")
    public void insert(Category category){
        categoryMapper.insert(category);
    }

    @RequestMapping("/category/delete")
    public void delete(int id){
        categoryMapper.delete(id);
    }
}
